﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OnlineManagement.DALFactory;
using OnlineManagement.IDAL;
namespace OnlineManagement.BLL
{
   public class ProcedureHandle
    {
       private readonly IProcedureHandle dal = DataAccess.CreateProcedureHandle();

       public ProcedureHandle() { }

       public System.Data.DataSet GetPigBaseInfoProcedure(int hoggeryId)
       {
           return dal.GetPigBaseInfoProcedure(hoggeryId);
       }

       /// <summary>
       /// 根据猪购买的类型获得相关的页面初始信息
       ///  return Dataset,品种-table 0,
       /// 合并可用的pigpen for hog-table 1,
       /// 合并可用的pigpen for piglet-table2,
       /// 整圈可用的pigpen-table 3,
       /// hog生长阶段, table 4,
       /// PIGLET生长阶段, table 5
       /// </summary>
       /// <param name="hoggeryId"></param>
       /// <returns>
       /// Dataset,品种-table 0,
       /// 合并可用的pigpen for hog-table 1,
       /// 合并可用的pigpen for piglet-table 2
       /// 整圈可用的pigpen,table 3
       /// hog生长阶段, table 4
       /// PIGLET生长阶段, table 5
       /// </returns>
       public System.Data.DataSet GetHogInfoForPurchase(int hoggeryId)
       {
           return dal.GetHogInfoForPurchase(hoggeryId);
       }

       public int AddPigPen(OnlineManagement.Model.PigPen pigPen,out string returnValue) {
           return dal.AddPigPen(pigPen,out returnValue);
       }

       /// <summary>
       ///  pigs grow phase changes,包括hog 和piglets成长阶段的改变
       /// </summary>
       /// <param name="hogID"></param>
       /// <param name="pigletID"></param>
       /// <param name="phaseFromID"></param>
       /// <param name="phaseToID"></param>
       /// <param name="changedDate"></param>
       /// <param name="pigPendID"></param>
       /// <param name="message"></param>
       /// <returns></returns>
       public bool HogsGrowPhaseChanged(int? hogID, int? pigletID, int phaseFromID, int phaseToID, DateTime changedDate, Guid? pigPendID, out string message)
       {
           return dal.HogsGrowPhaseChanged(hogID, pigletID, phaseFromID, phaseToID, changedDate, pigPendID, out message);
       }

    }
}
